﻿<view:ViewChildWindowBase x:Class="ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.Views.PeopleDetails"
                          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                          xmlns:view="clr-namespace:ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.Views"
                          xmlns:viewmodel="clr-namespace:ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.ViewModels"
                          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                          xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                          xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
                          xmlns:dataToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
                          Width="800"
                          Height="500"
                          AllowDrop="True"
                          Drop="ViewChildWindowBase_Drop"
                          Title="Dettaglio risorsa">
  <view:ViewChildWindowBase.Resources>
    <DataTemplate x:Key="SelectedModelDetailItemtemplate">
      <Border Padding="5"
              Width="80">
        <Border.Effect>
          <DropShadowEffect ShadowDepth="6"
                            Opacity="0.24"
                            BlurRadius="6" />
        </Border.Effect>
        <Border.Background>
          <LinearGradientBrush EndPoint="0.5,1"
                               StartPoint="0.5,0">
            <GradientStop Color="#FF8B8686"
                          Offset="1" />
            <GradientStop Color="White"
                          Offset="0.916" />
          </LinearGradientBrush>
        </Border.Background>
        <StackPanel>
          <Image Source="{Binding FileName, Converter={StaticResource MultimediaPathConverter}}"
                 Height="80"
                 Width="70"
                 Stretch="UniformToFill" />
        </StackPanel>
      </Border>
    </DataTemplate>

    <ItemsPanelTemplate x:Key="SelectedItemsPanelTemplate">
      <toolkit:WrapPanel />
    </ItemsPanelTemplate>
  </view:ViewChildWindowBase.Resources>

  <view:ViewChildWindowBase.ViewModel>
    <viewmodel:PeopleDetailsViewModel />
  </view:ViewChildWindowBase.ViewModel>
  <Grid x:Name="LayoutRoot"
        AllowDrop="True"
        Margin="2">
    <Grid.RowDefinitions>
      <RowDefinition />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <ScrollViewer>
      <StackPanel>
        <dataToolkit:DataForm x:Name="df1"
                              CurrentItem="{Binding Item}" />

        <ListBox x:Name="MultimediaList"
                 Grid.Row="1"
                 AllowDrop="True"
                 Drop="MultimediaList_Drop"
                 ItemTemplate="{StaticResource SelectedModelDetailItemtemplate}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 Style="{StaticResource SelectedModelListBox}"
                 ItemsSource="{Binding Multimedias, Mode=TwoWay}"
                 ItemsPanel="{StaticResource SelectedItemsPanelTemplate}"
                 Width="Auto"
                 HorizontalAlignment="Stretch"
                 Height="Auto"
                 VerticalAlignment="Stretch"></ListBox>
      </StackPanel>
    </ScrollViewer>

    <Button x:Name="CancelButton"
            Content="Annulla"
            Click="CancelButton_Click"
            Width="75"
            Height="23"
            HorizontalAlignment="Right"
            Margin="0,12,0,0"
            Grid.Row="1" />
    <Button x:Name="OKButton"
            Content="OK"
            Click="OKButton_Click"
            Width="75"
            Height="23"
            HorizontalAlignment="Right"
            Margin="0,12,79,0"
            Grid.Row="1" />
  </Grid>
</view:ViewChildWindowBase>